home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11116 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.9 KB

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Interest in comments on the C language.
  5. Date: 21 Mar 1996 15:47:40 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4ispqsINNkq0@keats.ugrad.cs.ubc.ca>
  8. References: <4inp40$kj2@ogre.cs.waikato.ac.nz>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <4inp40$kj2@ogre.cs.waikato.ac.nz>,
  12. Oliver R Jones <orj@cs.waikato.ac.nz> wrote:
  13. >Hiya all.  Copies of replies to email please.
  14. >
  15. >I'm interested in peoples comments on the following aspects of the C 
  16. >programming language.  Please be as objective as you can.. :)  I know that's
  17. >hard in a C advocacy group. :)
  18. >
  19. >1: Is C inheriantly efficient (speed and code space wise)?
  20.  
  21. Only when you sacrifice portability, which C lets you do for the sake of speed.
  22. This is because C allows many operations to map onto the idoms of the
  23. implementation's mative machine language. You can take advantage of
  24. implementation-defined behavior for some operations at the expense of
  25. sacrificing portability. Some other languages may define operations more
  26. strictly, leading to ``code explosion'' on architectures in whose machine
  27. language the defined operations can't be expressed efficiently.
  28.  
  29. >2: Is C inheriantly very readable and writable?  (Easy to code in and for non
  30. >   coders to read)
  31.  
  32. It is writable after you get used to it. Once you get addicted to C, _other_
  33. languages become non-writable. :) It's readable to experienced experts, though
  34. beginners may find it hard to read other people's programs. C requires a large
  35. character set, and makes lots of use of special symbols. Whereas an integer
  36. pointer may be declared in some language as ``pt : pointer to integer'', in C,
  37. you write ``int *pt;''. Whereas in some language you might write
  38. ``if x = 3 OR y = 4 ...'', in C you would use ``if (x == 3 || x == 4)''. 
  39. A non-coder would not know that || means ``OR'', so the expression would not
  40. appear intuitive. Another consideration is that C is case sensitive. Someone
  41. from a Pascal or Modula background will easily get tripped up when the variable
  42. he declared as 'MyString' is inaccessible through the 'Mystring' identifier.
  43.  
  44. Why would a non-coder be reading code, by the way? Would a non-musician care
  45. about reading a musical score?
  46.  
  47. >3: Is C a very simple language?
  48.  
  49. It's a simple language, but not overly so. The ISO/ANSI standard document which
  50. defines the language proper and the standard library is a mere 219 pages long.
  51. The K&R2 text which is used as a reference by most C programmers is very small
  52. as well.
  53.  
  54. >4: Is it consistant with accepted mathematical notations?
  55.  
  56. No. Accepted mathematical notations are completely beyond the scope of any
  57. programming language. First of all, mathematical notation is often ambiguous
  58. and highly context dependent. Secondly, it is two-dimensional, rather than a
  59. linear sequence of tokens (just look at continued fractions, integrals,
  60. summations, square roots and so forth). This question is practically
  61. meaningless since mathematical notation is very rich and varied!
  62.  
  63. If you want to know more about C's expression grammar, consult a reference
  64. manual or a tutorial. 
  65.  
  66. C is not a mathematical language. It does not solve equations, or perform
  67. integrals symbolically or anything of the sort.
  68.  
  69. >5: Why was C designed and for what purpose?
  70.  
  71. C was designed to rewrite an early version of the  UNIX operating system in a
  72. high level language which would allow the system to be expressed in terms of
  73. abstract data and control structures. so that the system could be made portable
  74. to various architectures. It continues to be the primary development language
  75. on UNIX systems to this date, and is suitable for application development as
  76. well as system-level programming (operating system code, embedded kernels and
  77. the like). It's good for graphics, numerical analysis, text processing,
  78. compiler construction, device control... etc.
  79.  
  80. -- 
  81.  
  82.